$(function () {
    var phone = $('.phone').val();
    var pwd = $('.pwd').val();
    
     //为注册按钮添加事件
     $('.denglu').on('click',function (e) {
        e.preventDefault();
            var userList = JSON.parse(localStorage.getItem('userList')) || [];
            for(var i=0;i<userList.length;i++){
                for (key in userList[i]) {
                    console.log(userList[i]);
                   if (phone == userList[i].userName && pwd == userList[i].passWord) {
                       window.location.href = "../../index.html";
                   }else{
                    $('.error').html("*用户名或密码错误");
                   }
                }
            }
    })
    
})

